Node-RED block in Snap4City Microservice library node-red-contrib-snap4city-user is "fiware-orion-out">
Provides a node for sending generic json payload to Fiware Orion context broker.
Configuration
- Authentication (only available on edge scenario)
- Configuration options for Snap4city Authentication (optional)
- Service
- The URL and port of the Fiware Orion context broker (mandatory).
The URL should not contains any prefix for http/https and any port information (valid example are: 192.168.1.10 or www.example.it or orionUNIFI)
- Certificates
- Configuration for TLS connections (optional). If "verify server certificate" is selected, the CA certificate is mandatory
- Device Type
string
- Context element entity type (optional)
- Device Identifier
string
- Context element entity id (optional)
- key 1
string
- K1 credential to be specified for context broker secured via Snap4City-OrionFilter (optional). It can be passed in
msg.auth.k1
(see example below)
- key 2
string
- K2 credential to be specified for context broker secured via Snap4City-OrionFilter (optional). It can be passed in
msg.auth.k2 (see example below)
- Service/Tenant
string
- Tenant of the Device to be specified if the context broker support Multi-Tenancy (optional)
- Service Path
string
- Service Path of the Device to be specified if the context broker support Multi-Tenancy/Service Path hierarchy (optional)
- apikey
string
- Credential to be specified for context broker secured via HTTP Header "apikey:<credential>" (optional). It can be passed in
msg.auth.apikey (see example below)
- auth
string
- Credential to be specified for context broker secured via HTTP Header "Authorization: <credential>" (optional). It can be passed in
msg.auth.basicAuth (see example below)
If this parameter is not specified, the Snap4City SSo AccessToken will be used (based on (cloud scenario)
the logged user credentials or (edge scenario) the specified username/password) in the form of "Authorization: Bearer <credential>"
- name
string
- Label assigned to the current node (optional)
Inputs
A JSON representing the payload to send to the Fiware Orion context broker. Can be:
- the complete contextElements (not an array):
msg.payload = { "id": "angelo-mydevice001", "type": "test-device", "attributes": [{ "name": "temperatura", "value": "8", "type": "float" }] };
NOTE: if msg.payload.type and msg.payload.id are not present, the "Device Type" and "Device Identifier" has to be specified in the Configuration section (mandatory)
- the simple attributes (an array)
msg.payload = [{ "name": "temperatura", "value": "12", "type": "float" }];
NOTE: the "Device Type" and "Device Identifier" has to be specified in the Configuration section (mandatory)
An optional JSON representing the set of Credentials (used just if not specified in UI)
msg.auth={"k1": "1ef0e5e8-bf0c-48d4-9462-0aa4cfcf5e19","k2": "b2b34425-9d97-4fc5-818d-2d6cac2314a6","apikey":"apikey","basicAuth": "basicAuthKey"};
Details
The node receive a JSON as described in the Inputs section and send a message to the Fiware Broker context broker based on the specified Configuration.
If the values are not present in the input JSON an error is generated.